
<<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@ taglib uri="http://java.sun.com/jstl/sql" prefix="sql" %>

<sql:setDataSource    
    driver="sun.jdbc.odbc.JdbcOdbcDriver"
    password = "alku"
    url="jdbc:oracle:thin:@localhost:1521:XE"
    user= "alku"
    scope="session"
    />

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Sport Planet</title>
        <link rel="stylesheet" type="text/css" href="style.css">
    </head>
    <body>
        <h1 align="center">Tournaments</h1>

        <sql:query var="items" sql="SELECT * FROM TOURNAMENT"/>

        <table  align="center" valign="center">
            <thead>
                <tr>
                    <th><strong> ID :</strong></th>
                    <th><strong> NAME :</strong></th>
                    <th><strong> LEAGUE :</strong></th>
                    <th><strong> DATE OF INCEPTION :</strong></th>
                    <th> <strong> DATE OF END :</strong></th>
                    <th><strong> DATE OF INCEPTION OF REGISTRATION :</strong></th>
                    <th><strong> DATE OF END OF REGISTRATION :</strong></th>
                    <th><strong> STATUS :</strong></th>
                </tr>
            </thead>

            <c:forEach var="row" items="${items.rows}">
                <tr>
                    <td>  <c:out value="${row.tournament_id}"/></td>
                    <td> <c:out value="${row.name}"/></td>
                    <td> <c:out value="${row.league_id}"/></td>
                    <td> <c:out value="${row.DATE_OF_INCEPTION}"/></td>
                    <td><c:out value="${row.DATE_OF_END }"/></td>
                    <td><c:out value="${row.DATE_OF_INCEPT_REG}"/></td> 
                    <td>  <c:out value="${row.DATE_OF_END_REG}"/></td>
                    <td> <c:out value="${row.STATUS}"/></td>

                </c:forEach>
        </table>

    </body>
</html>
